#include "Arduino.h"
#include "DriveTrain.h"
#include "Wheel.h"

DriveTrain::DriveTrain(int leftWheels[][PIECES_OF_WHEEL_INFO], int rightWheels [][PIECES_OF_WHEEL_INFO], int numOfWheelsLeft, int numOfWheelsRight){
	    Wheel _leftSide[], _rightSide[];
	int _numOfWheelsLeft, _numOfWheelsRight;

	_numOfWheelsLeft = numOfWheelsLeft;
	_numOfWheelsRight = numOfWheelsRight;

	for(int i = 0; i < numOfWheelsLeft; i++){
		for(int j = 0; j < PIECES_OF_WHEEL_INFO; j++){

		}
	}

	for(int i = 0; i < numOfWheelsRight; i++){
	
	}



}

void DriveTrain::rightForward(int duty){
	for(int i = 0; i < _numOfWheelsRight; i++){  //Set the duty cycle on all of the wheels on the right side
		analogWrite(_rightSide[i].frontPin, duty);
		analogWrite(_rightSide[i].backPin, 0);
	}
  //analogWrite(TopRight.frontPin, duty);
 // analogWrite(TopRight.backPin, 0);
 // analogWrite(BottomRight.frontPin, duty);
  //analogWrite(BottomRight.backPin, 0);
}

void DriveTrain::rightBackward(int duty){
	for(int i = 0; i < _numOfWheelsRightt; i++){  
		analogWrite(_rightSide[i].frontPin, 0);
		analogWrite(_rightSide[i].backPin, duty);
	}
}

void DriveTrain::leftForward(int duty){
	for(int i = 0; i < _numOfWheelsLeft; i++){
		analogWrite(_leftSide[i].frontPin, duty);
		analogWrite(_leftSide[i].backPin, 0);
	}
}

void DriveTrain::leftBackward(int duty){
	for(int i = 0; i < _numOfWheelsLeft; i++){ 
		analogWrite(_leftSide[i].frontPin, 0);
		analogWrite(_leftSide[i].backPin, duty);
	}
}